﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SellerProject.testfolder
{
    public partial class usershow : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            UserCollection users = DAL.GetAllUsers();
            repeater.DataSource = users;
            repeater.DataBind();
        }

        protected void r_ItemDataBound(object sender, RepeaterItemEventArgs e) {
            ListItemType type = e.Item.ItemType;
            if (type == ListItemType.AlternatingItem || type == ListItemType.Item)
            {
                Label ul = (Label)e.Item.FindControl("userName");
                User currentUser = (User)e.Item.DataItem;
                if (!PasswordUtility.PasswordIsSecure(currentUser.Password))
                {
                    ul.ForeColor = Color.Red;
                }
            }
        }
    }
}